package com.bili.bili_data_api.controller;

import com.bili.bili_data_api.dao.pojo.bangumi;
import com.bili.bili_data_api.service.FanJvService;
import com.bili.bili_data_api.util.Result;
import com.bili.bili_data_api.vo.FanJvList;
import com.bili.bili_data_api.vo.FanJvVo;
import com.bili.bili_data_api.vo.QueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("fanjv")
public class FanJvController {

    @Autowired
    private FanJvService fanJvService;

//    @GetMapping("getAll")
//    public FanJvVo getAll(){
//        return fanJvService.getAll();
//    }
    @PostMapping(value = {"getAll"},produces = {"application/json; charset=UTF-8"})
    public FanJvVo getAll(@RequestBody QueryVo query){
        return fanJvService.getAll(query);
    }

    @PostMapping(value = {"edit"},produces = {"application/json; charset=UTF-8"})
    public Result edit(@RequestBody FanJvList fanJvVo){
        return fanJvService.edit(fanJvVo);
    }
    @PostMapping(value = {"delete"},produces = {"application/json; charset=UTF-8"})
    public Result delete(@RequestBody FanJvList fanJvVo){
        return fanJvService.delete(fanJvVo);
    }
    @PostMapping(value = {"add"},produces = {"application/json; charset=UTF-8"})
    public Result add(@RequestBody bangumi fanJvVo){
        return fanJvService.add(fanJvVo);
    }
    @PostMapping(value = {"selectByTitle"},produces = {"application/json; charset=UTF-8"})
    public FanJvVo selectByTitle(@RequestBody QueryVo query){
        return fanJvService.selectByTitle(query);
    }
}
